<template>
  <div>
    <div class="tabbar">
      <div class="wrap tabbarwrap">
        <div class="left">
          <p>欢迎来到叩丁狼积分商城</p>
        </div>
        <ul class="right">
          <li>
            <img src="../assets/img/1.png" alt="" class="img1"/>
            用户名：游客
          </li>
          <li>我的积分：--</li>
          <li>获取积分</li>
          <li>叩丁狼官网</li>
           <li class="login" v-if="isshowCart">
            <img src="../assets/img/cart.png" alt="" class="img2">
           <span>购物车</span>
           <strong>{{cartTotal}}</strong>
            </li>
          <li class="login" @click="changeIsshowLoginModel(true)" v-else>登录</li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState} from 'vuex';
export default {
  data() {
    return {
      cartTotal:0
    };
  },
  computed:{
    ...mapState({
        isshowCart:state=>state.loginStatus.isshowCart
    })
  },
 methods:{
   ...mapMutations({
     changeIsshowLoginModel:"showModel/changeIsshowLoginModel"
   })
 }
};
</script>
 
<style lang = "less" scoped>
.tabbar {
  height: 40px;
  background: #242b39;
  .tabbarwrap {
    font-size: 14px;
    font-family: SourceHanSansSC;
    font-weight: 300;
    color: #fffefe;
    display: flex;
    justify-content: space-between;
    line-height: 40px;
    .right {
      display: flex;
      li {
        margin-left: 20px;
        text-align: center;
         cursor: pointer;
        .img1{
          width: 26px;
          height: 26px;
          vertical-align: middle;
          border: 1px solid #8891a1;
          border-radius: 13px;
        }
         .img2{
          width: 20px;
          height: 19px;
          vertical-align: middle;
        }
         span{
          margin: 0 8px;
        }
        strong{
          width: 22px;
          height: 22px;
          line-height: 22px;
          display: inline-block;
          border-radius: 50%;
          background-color: #fd604d;
        }
      }
      .login {
        width: 124px;
        height: 40px;
        background: #0a328e;
       
      }
    }
  }
}
</style>